package cc.ding.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class EmployeeIDGenerator {
    private static int count = 0;

    public static synchronized String generateEmployeeID(){
        count++;
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
        String timestamp = dateFormat.format(new Date());
        return "C"+timestamp+String.format("%03d", count);
    }

    public static void main(String[] args) {
        System.out.println(generateEmployeeID());
        System.out.println(generateEmployeeID());
        System.out.println(generateEmployeeID());
    }
}
